﻿CREATE PROCEDURE ProductImage_GetDefaultProductImage
	@productId int
AS
	SET NOCOUNT ON
	declare @defImgId int
		select 
			@defImgId = DefaultImageId 
		from 
			Products 
		where 
			ProductId = @productId
		
		select 
			* 
		from 
			ProductImages 
		where 
			ImageId = @defImgId
	RETURN


